const str = `
-- 覆盖user表
DROP TABLE IF EXISTS user;
CREATE TABLE user (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '用户Id',
invite_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '邀请人的Id',
phone CHAR(11) COMMENT '电话号码（账号）',
password VARCHAR(16) NOT NULL DEFAULT 'password123456' COMMENT '密码：6~16位字母+数字组合',
user_name VARCHAR(10) COMMENT '用户真实姓名',
nickname VARCHAR(16) COMMENT '用户昵称',
gender TINYINT(1) UNSIGNED DEFAULT 0 COMMENT '性别 注：0未知 1男 2女',
age TINYINT(3) UNSIGNED DEFAULT 0 COMMENT '年龄',
role TINYINT UNSIGNED NOT NULL DEFAULT 1 COMMENT '角色Id（类型）',
coin INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '金币余额',
vip_type TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '会员类型 注：0非会员 1普通会员 2超级会员',
vip_expire DATETIME COMMENT '会员到期时间',
status TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '账号状态',
avatar VARCHAR(100) COMMENT '头像',
birthday DATE COMMENT '出生日期',
email VARCHAR(100) COMMENT '邮箱',
produce VARCHAR(100) COMMENT '个人简介',
experience INT UNSIGNED DEFAULT 0 COMMENT '经验值',
tags JSON COMMENT '用户标签',
industry_id SMALLINT UNSIGNED NOT NULL DEFAULT 1 COMMENT '行业Id',
last_time DATETIME COMMENT '最后登录时间',
last_ip VARCHAR(16) COMMENT '最后登录IP地址',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '注册时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户表';

-- 插入user表
INSERT INTO user
(nickname, user_name, phone, password, gender, age, role, vip_type, invite_id, coin, status, experience, industry_id, create_time)
VALUES
('一只小白兔', '李大', '18483221111', 'mstx123456', '1', '19', '2', '2', '0', '0', '1', '0', '1', CURRENT_TIMESTAMP),
('冰糖雪梨', '王二', '18483221112', 'mstx123456', '2', '54', '1', '1', '0', '0', '1', '0', '1', CURRENT_TIMESTAMP),
('好名字都被猪起了', '张三', '18483221113', 'mstx123456', '0', '26', '0', '1', '0', '0', '1', '0', '1', CURRENT_TIMESTAMP),
('唔系唔懂', '李四', '18483221114', 'mstx123456', '0', '44', '0', '0', '0', '0', '1', '0', '1', CURRENT_TIMESTAMP),
('么么哒呀', '王五', '18483221115', 'mstx123456', '2', '34', '0', '0', '0', '0', '1', '0', '1', CURRENT_TIMESTAMP),
('你还在等我吗', '李梅', '18483221116', 'mstx123456', '1', '24', '0', '0', '0', '0', '1', '0', '1', CURRENT_TIMESTAMP);



-- 覆盖user_relations表
DROP TABLE IF EXISTS user_relations;
CREATE TABLE user_relations (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '主键id',
focus_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '关注者Id',
focused_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '被关注者Id',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户关系表';

-- 插入user_relations表
INSERT INTO user_relations
(focus_id, focused_id, create_time)
VALUES
('2', '1', CURRENT_TIMESTAMP),
('3', '1', CURRENT_TIMESTAMP),
('4', '1', CURRENT_TIMESTAMP),
('5', '1', CURRENT_TIMESTAMP),
('6', '1', CURRENT_TIMESTAMP),
('1', '2', CURRENT_TIMESTAMP),
('3', '2', CURRENT_TIMESTAMP),
('4', '3', CURRENT_TIMESTAMP);



-- 覆盖visitor表
DROP TABLE IF EXISTS visitor;
CREATE TABLE visitor (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '主键id',
visitor_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '访客Id',
visited_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '被访问者Id',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='访客记录表表';

-- 插入visitor表
INSERT INTO visitor
(visited_id, visitor_id, create_time)
VALUES
('1', '2', CURRENT_TIMESTAMP),
('1', '3', CURRENT_TIMESTAMP),
('1', '4', CURRENT_TIMESTAMP),
('1', '5', CURRENT_TIMESTAMP),
('2', '1', CURRENT_TIMESTAMP),
('2', '1', CURRENT_TIMESTAMP),
('2', '3', CURRENT_TIMESTAMP),
('2', '4', CURRENT_TIMESTAMP),
('3', '5', CURRENT_TIMESTAMP),
('3', '1', CURRENT_TIMESTAMP),
('3', '2', CURRENT_TIMESTAMP),
('4', '1', CURRENT_TIMESTAMP),
('5', '2', CURRENT_TIMESTAMP);



-- 覆盖system_notice表
DROP TABLE IF EXISTS system_notice;
CREATE TABLE system_notice (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '主键id',
accept_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '接收者Id',
type TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '消息类型 注：1系统维护 2平台活动 3意见反馈通知 4举报反馈通知 5被举报通知 6金币奖励发放 11新增粉丝 12点赞 13点踩 14收藏 15分享 16评论 17私信',
is_read TINYINT(1) UNSIGNED DEFAULT 0 COMMENT '是否已读',
create_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
title VARCHAR(25) COMMENT '消息标题',
content VARCHAR(500) COMMENT '消息内容'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统消息表';

-- 插入system_notice表
INSERT INTO system_notice
(accept_id, type, title, content, is_read, create_id, create_time)
VALUES
('1', '1', '系统维护升级', '系统将于xxx至xxx维护升级，给您带来的不便，敬请谅解', '0', '0', CURRENT_TIMESTAMP),
('2', '2', '平台活动', '这是平台活动消息的消息内容', '0', '0', CURRENT_TIMESTAMP),
('3', '3', '意见反馈通知', '这是意见反馈通知消的消息内容', '0', '0', CURRENT_TIMESTAMP),
('4', '4', '举报反馈通知', '这是举报反馈通知消的消息内容', '0', '0', CURRENT_TIMESTAMP),
('5', '5', '被举报通知', '这是被举报通知消的消息内容', '0', '0', CURRENT_TIMESTAMP),
('6', '6', '金币奖励发放', '这是金币奖励发放消的消息内容', '0', '0', CURRENT_TIMESTAMP),
('1', '11', '新增粉丝', '这是新增粉丝消的消息内容', '0', '0', CURRENT_TIMESTAMP),
('1', '12', '点赞', '这是点赞消的消息内容', '0', '0', CURRENT_TIMESTAMP),
('1', '13', '点踩', '这是点踩消的消息内容', '0', '0', CURRENT_TIMESTAMP),
('1', '14', '收藏', '这是收藏消的消息内容', '0', '0', CURRENT_TIMESTAMP),
('1', '15', '分享', '这是分享消的消息内容', '0', '0', CURRENT_TIMESTAMP),
('1', '16', '评论', '这是评论消的消息内容', '0', '0', CURRENT_TIMESTAMP),
('1', '17', '私信', '这是私信消的消息内容', '0', '0', CURRENT_TIMESTAMP);



-- 覆盖role表
DROP TABLE IF EXISTS role;
CREATE TABLE role (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '角色Id',
code TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '标识 注：0普通用户 1普通会员 2超级会员 6普通管理员 7超级管理员',
create_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_id INT UNSIGNED DEFAULT 0 COMMENT '最后修改人',
update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='角色表';

-- 插入role表
INSERT INTO role
(code, create_time, create_id, update_time, update_id)
VALUES
('0', '2025-06-01 07:32:33', '1', '2025-06-01 07:33:05', '3'),
('1', '2025-06-01 07:32:33', '2', '2025-06-01 07:33:05', '2'),
('2', '2025-06-01 07:32:33', '3', '2025-06-01 07:33:05', '3'),
('6', '2025-06-01 07:32:33', '4', '2025-06-01 07:33:05', '3'),
('7', '2025-06-01 07:32:33', '5', '2025-06-01 07:33:05', '3');



-- 覆盖topic表
DROP TABLE IF EXISTS topic;
CREATE TABLE topic (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '题目Id',
industry_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属行业Id',
title VARCHAR(255) COMMENT '题目问题',
content VARCHAR(10000) COMMENT '回答内容',
create_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_id INT UNSIGNED DEFAULT 0 COMMENT '最后修改人',
update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
exposure_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '曝光量',
view_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '浏览量',
comment_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '评论数量',
praise_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '点赞数量',
belittle_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '点踩数量',
collect_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '收藏数量',
share_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '分享数量',
report_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '举报数量',
score DECIMAL(4, 2) DEFAULT '10.00' COMMENT '分数，最小0，最大10',
audit_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '审核Id',
status TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '启用状态',
visible_type TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '可见状态 注：0私密 1仅指定用户可见 2仅粉丝可见 3公开',
tags JSON COMMENT '分类标签',
history_id JSON COMMENT '历史记录Id',
remark VARCHAR(50) COMMENT '备注'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='题目表';

-- 插入topic表
INSERT INTO topic
(industry_id, title, content, create_id, tags, create_time, update_id, exposure_num, view_num, comment_num, praise_num, belittle_num, collect_num, share_num, report_num, score, audit_id, status, visible_type)
VALUES
('1', '这是问题1', '这是内容1', '1', '[1,2,3]', CURRENT_TIMESTAMP, '0', '0', '0', '0', '0', '0', '0', '0', '0', '10.00', '0', '1', '0'),
('2', '这是问题2', '这是内容2', '2', '[2,3]', CURRENT_TIMESTAMP, '0', '0', '0', '0', '0', '0', '0', '0', '0', '10.00', '0', '1', '0'),
('3', '这是问题3', '这是内容3', '3', '[3]', CURRENT_TIMESTAMP, '0', '0', '0', '0', '0', '0', '0', '0', '0', '10.00', '0', '1', '0'),
('4', '这是问题4', '这是内容4', '4', '[2,3]', CURRENT_TIMESTAMP, '0', '0', '0', '0', '0', '0', '0', '0', '0', '10.00', '0', '1', '0'),
('5', '这是问题5', '这是内容5', '5', '[1,2,3]', CURRENT_TIMESTAMP, '0', '0', '0', '0', '0', '0', '0', '0', '0', '10.00', '0', '1', '0'),
('6', '这是问题6', '这是内容6', '6', '[1]', CURRENT_TIMESTAMP, '0', '0', '0', '0', '0', '0', '0', '0', '0', '10.00', '0', '1', '0'),
('7', '这是问题7', '这是内容6', '6', '[2]', CURRENT_TIMESTAMP, '0', '0', '0', '0', '0', '0', '0', '0', '0', '10.00', '0', '1', '0'),
('8', '这是问题8', '这是内容6', '6', '[2]', CURRENT_TIMESTAMP, '0', '0', '0', '0', '0', '0', '0', '0', '0', '10.00', '0', '1', '0'),
('9', '这是问题9', '这是内容6', '6', '[3]', CURRENT_TIMESTAMP, '0', '0', '0', '0', '0', '0', '0', '0', '0', '10.00', '0', '1', '0'),
('10', '这是问题10', '这是内容10', '6', '[1,2,3]', CURRENT_TIMESTAMP, '0', '0', '0', '0', '0', '0', '0', '0', '0', '10.00', '0', '1', '0');



-- 覆盖note表
DROP TABLE IF EXISTS note;
CREATE TABLE note (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '笔记Id',
title VARCHAR(25) COMMENT '文章（笔记）标题',
topic_ids JSON COMMENT '题目Id',
create_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_id INT UNSIGNED DEFAULT 0 COMMENT '最后修改人',
update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
exposure_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '曝光量',
view_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '浏览量',
comment_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '评论数量',
praise_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '点赞数量',
belittle_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '点踩数量',
collect_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '收藏数量',
share_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '分享数量',
report_num INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '举报数量',
read_seconds SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '阅读耗时（计算：7字秒）',
score DECIMAL(4, 2) DEFAULT '10.00' COMMENT '分数，最小0，最大10',
audit_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '审核Id',
status TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '启用状态',
visible_type TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '可见状态 注：0私密 1仅指定用户可见 2仅粉丝可见 3公开',
tags JSON COMMENT '分类标签',
history_id JSON COMMENT '历史记录Id',
remark VARCHAR(50) COMMENT '备注'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='笔记表';

-- 插入note表
INSERT INTO note
(id, title, topic_ids, create_id, exposure_num, view_num, comment_num, praise_num, belittle_num, collect_num, share_num, report_num, tags, create_time, update_id, read_seconds, score, audit_id, status, visible_type)
VALUES
('1', '这是笔记标题1', '[1,3,5,6,7,9]', '1', '12323', '12', '11', '82', '23', '23', '39', '6', '[1,2,3]', CURRENT_TIMESTAMP, '0', '0', '10.00', '0', '1', '0'),
('2', '这是笔记标题2', '[2,4,6,8,10]', '2', '12', '10', '20', '30', '40', '10', '20', '9', '[6]', CURRENT_TIMESTAMP, '0', '0', '10.00', '0', '1', '0'),
('3', '这是笔记标题3', '[1,2,3]', '3', '2', '1', '3', '4', '6', '7', '9', '1', '[1,6]', CURRENT_TIMESTAMP, '0', '0', '10.00', '0', '1', '0'),
('4', '这是笔记标题4', '[5,2,6]', '4', '0', '0', '0', '0', '0', '0', '0', '0', '[1,6]', CURRENT_TIMESTAMP, '0', '0', '10.00', '0', '1', '0'),
('5', '这是笔记标题5', '[2,4,2,4,6]', '5', '0', '0', '0', '0', '0', '0', '0', '0', '[1,6]', CURRENT_TIMESTAMP, '0', '0', '10.00', '0', '1', '0'),
('6', '这是笔记标题6', '[4,2,6,8,9]', '6', '0', '0', '0', '0', '0', '0', '0', '0', '[4,5,6]', CURRENT_TIMESTAMP, '0', '0', '10.00', '0', '1', '0'),
('7', '这是笔记标题7', '[1,2,4]', '6', '0', '0', '0', '0', '0', '0', '0', '0', '[2,3,5]', CURRENT_TIMESTAMP, '0', '0', '10.00', '0', '1', '0'),
('8', '这是笔记标题8', '[4,5,7]', '6', '0', '0', '0', '0', '0', '0', '0', '0', '[1,5,6]', CURRENT_TIMESTAMP, '0', '0', '10.00', '0', '1', '0'),
('9', '这是笔记标题9', '[2,4,1,8]', '6', '0', '0', '0', '0', '0', '0', '0', '0', '[6]', CURRENT_TIMESTAMP, '0', '0', '10.00', '0', '1', '0'),
('10', '这是笔记标题10', '[2,4,1,8]', '6', '0', '0', '0', '0', '0', '0', '0', '0', '[5]', CURRENT_TIMESTAMP, '0', '0', '10.00', '0', '1', '0');



-- 覆盖tag表
DROP TABLE IF EXISTS tag;
CREATE TABLE tag (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '主键Id',
type TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '标签类型 注：1文章/题目 2用户',
name VARCHAR(16) COMMENT '标签名称',
create_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_id INT UNSIGNED DEFAULT 0 COMMENT '最后修改人',
update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='标签表';

-- 插入tag表
INSERT INTO tag
(type, name, create_id, update_id, create_time)
VALUES
('1', '前端', '1', '1', CURRENT_TIMESTAMP),
('1', 'CSS', '2', '1', CURRENT_TIMESTAMP),
('1', 'JavaScript', '1', '1', CURRENT_TIMESTAMP),
('1', 'TypeScript', '2', '1', CURRENT_TIMESTAMP),
('1', 'NodeJS', '2', '3', CURRENT_TIMESTAMP),
('2', '资深作者', '4', '2', CURRENT_TIMESTAMP),
('2', '萌新观众', '3', '2', CURRENT_TIMESTAMP);



-- 覆盖audit表
DROP TABLE IF EXISTS audit;
CREATE TABLE audit (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '主键Id',
type TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '审核类型 注：1文章 2笔记 3用户认证',
audit_status TINYINT(1) UNSIGNED COMMENT '审核状态',
create_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_id INT UNSIGNED DEFAULT 0 COMMENT '最后修改人',
update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='审核表';



-- 覆盖attitude表
DROP TABLE IF EXISTS attitude;
CREATE TABLE attitude (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '表态Id',
target_type TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '表态对象类型 注：1笔记（文章） 2题目',
attitude_type TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '表态类型 注：1点赞 2点踩 3收藏 4分享 5举报 6评论',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
create_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
remark VARCHAR(50) COMMENT '备注'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='表态表';



-- 覆盖feedback表
DROP TABLE IF EXISTS feedback;
CREATE TABLE feedback (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '反馈Id',
advice VARCHAR(500) COMMENT '意见描述',
type TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '反馈类型 注：0其他 1用户体验 2程序BUG 3平台建议',
status TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '反馈状态 注：0待审核 1接受 2忽略',
imgs JSON COMMENT '图片描述',
create_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
remark VARCHAR(50) COMMENT '备注'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='意见反馈表';



-- 覆盖report表
DROP TABLE IF EXISTS report;
CREATE TABLE report (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '举报Id',
type TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '举报类型 注：0其他 1低俗色情 2内容抄袭 3涉嫌违法 4恶意营销 11名誉 12隐私 13著作 14肖像权',
status TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '举报状态 注：0待审核 1接受 2忽略 3驳回',
reason VARCHAR(500) COMMENT '举报原因',
imgs JSON COMMENT '图片描述',
create_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
remark VARCHAR(50) COMMENT '备注'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='举报表';

-- 插入report表
INSERT INTO report
(type, reason, status, create_id, create_time)
VALUES
('0', '因为xxxx', '0', '0', CURRENT_TIMESTAMP),
('1', '没有更多原因', '0', '0', CURRENT_TIMESTAMP),
('2', '', '0', '0', CURRENT_TIMESTAMP),
('3', '', '0', '0', CURRENT_TIMESTAMP),
('4', '', '0', '0', CURRENT_TIMESTAMP),
('11', '', '0', '0', CURRENT_TIMESTAMP),
('12', '', '0', '0', CURRENT_TIMESTAMP),
('13', '', '0', '0', CURRENT_TIMESTAMP),
('14', '', '0', '0', CURRENT_TIMESTAMP);



-- 覆盖notice表
DROP TABLE IF EXISTS notice;
CREATE TABLE notice (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '消息Id',
type TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '消息类型 注：0系统消息 1点赞 2点踩 3收藏 4分享 5举报 6评论 7新增粉丝 8私信',
status TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '已读状态 注：0未读 1已读',
user_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '接收消息的用户Id',
create_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
remark VARCHAR(50) COMMENT '备注'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='notice表';



-- 覆盖orders表
DROP TABLE IF EXISTS orders;
CREATE TABLE orders (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '订单Id',
user_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户Id',
goods_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品Id（套餐Id）',
order_no CHAR(19) COMMENT '订单编号',
pay_type TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '支付方式（类型） 注：1金币 2人民币',
amount TINYINT UNSIGNED NOT NULL DEFAULT 1 COMMENT '套餐份数',
ratio DECIMAL(3, 2) DEFAULT '1.00' COMMENT '折扣率',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
pay_time DATETIME COMMENT '支付时间',
expire_time DATETIME COMMENT '到期时间',
status TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '支付状态 注：0未支付 1已支付 2已取消',
remark VARCHAR(50) COMMENT '备注'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='订单表';

-- 插入orders表
INSERT INTO orders
(goods_id, user_id, order_no, pay_type, amount, ratio, create_time, status)
VALUES
('1', '1', '2589224233526742751', '1', '1', '1.00', CURRENT_TIMESTAMP, '0'),
('2', '2', '2589224233526742752', '1', '1', '1.00', CURRENT_TIMESTAMP, '0'),
('1', '2', '2589224233526742753', '1', '1', '1.00', CURRENT_TIMESTAMP, '0'),
('2', '1', '2589224233526742754', '1', '1', '1.00', CURRENT_TIMESTAMP, '0'),
('1', '2', '2589224233526742755', '1', '1', '1.00', CURRENT_TIMESTAMP, '0'),
('1', '1', '2589224233526742756', '1', '1', '1.00', CURRENT_TIMESTAMP, '0'),
('2', '2', '2589224233526742757', '1', '1', '1.00', CURRENT_TIMESTAMP, '0'),
('1', '2', '2589224233526742758', '1', '1', '1.00', CURRENT_TIMESTAMP, '0'),
('1', '3', '2589224233526742759', '1', '1', '1.00', CURRENT_TIMESTAMP, '0');



-- 覆盖set_meals表
DROP TABLE IF EXISTS set_meals;
CREATE TABLE set_meals (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '套餐Id',
type TINYINT(2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品类型 注：0存储空间 1普通会员 2超级会员 4金币 5精力',
amount INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '存储空间（G）、会员时长（小时、天）、金币数量（个）、精力数量（点）',
produce VARCHAR(100) COMMENT '套餐描述',
now_price DECIMAL(5, 2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '现价',
old_price DECIMAL(5, 2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '原价',
status TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '启用状态',
create_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_id INT UNSIGNED DEFAULT 0 COMMENT '最后修改人',
update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
remark VARCHAR(50) COMMENT '备注'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='套餐表';

-- 插入set_meals表
INSERT INTO set_meals
(type, amount, old_price, now_price, status, create_id, create_time, update_id)
VALUES
('0', '1', '2', '1', '1', '0', CURRENT_TIMESTAMP, '0'),
('1', '1', '2', '1', '1', '0', CURRENT_TIMESTAMP, '0'),
('2', '1', '12', '9.9', '1', '0', CURRENT_TIMESTAMP, '0'),
('1', '1', '28', '19', '1', '0', CURRENT_TIMESTAMP, '0'),
('2', '1', '46', '39', '1', '0', CURRENT_TIMESTAMP, '0'),
('5', '1', '46', '39', '1', '0', CURRENT_TIMESTAMP, '0');



-- 覆盖operate_status表
DROP TABLE IF EXISTS operate_status;
CREATE TABLE operate_status (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '操作Id',
type TINYINT(1) UNSIGNED NOT NULL DEFAULT 12 COMMENT '操作类型 注：12点赞 13点踩 14收藏 15分享 16评论 17私信 18举报',
status TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否操作过（0否1是）',
create_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='操作状态表';
ALTER TABLE operate_status ADD UNIQUE INDEX uk_createId_type (create_id, type);
-- 插入operate_status表
INSERT INTO operate_status
(type, status, create_id, create_time)
VALUES
('12', '1', '1', CURRENT_TIMESTAMP),
('13', '1', '2', CURRENT_TIMESTAMP),
('14', '0', '3', CURRENT_TIMESTAMP),
('15', '1', '4', CURRENT_TIMESTAMP),
('16', '1', '5', CURRENT_TIMESTAMP),
('17', '0', '6', CURRENT_TIMESTAMP),
('18', '0', '7', CURRENT_TIMESTAMP);



-- 覆盖operate_log表
DROP TABLE IF EXISTS operate_log;
CREATE TABLE operate_log (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '日志Id',
business TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属类型 注：0业务1 1业务2',
operate_type TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作类型 注：0创建 1删除',
operate_id INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作人Id',
operate_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '操作时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='操作日志表';
`;
